namespace Trader.DataServices.FilesData
{
    using System;
    using System.IO;
    using System.Text;

    public class File : IFile
    {
        #region Private Member

        private readonly string resourceName;

        #endregion

        #region Cons'

        public File(string resourceName)
        {
            if (resourceName == null)
            {
                throw new ArgumentNullException();
            }
            this.resourceName = resourceName;
        }

        #endregion

        #region IFile Members

        public TextReader GetReader()
        {
            return new StreamReader(GetType().Assembly.GetManifestResourceStream(resourceName),
                                    Encoding.GetEncoding(1255));
        }

        #endregion
    }
}